{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5268520f-7fbd-434c-848c-99c6c8b697b7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "请输入x： 2\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Pow(e,x) =  7.3890560703259105\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "x = float(input(\"请输入x：\"))\n",
    "i = 1; s = 1; t = 1\n",
    "while (t >= pow(10,-6)):\n",
    "    t *= x/i; s += t;  i+=1\n",
    "print(\"Pow(e,x) = \",s)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c7282c44-17b8-4a11-a371-0845047bb2e3",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
